package com.yizhu.zczy.system.controller;

import java.util.Arrays;
import java.util.Map;


import com.yizhu.zczy.common.utils.PageUtils;
import com.yizhu.zczy.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yizhu.zczy.system.entity.PopedomEntity;
import com.yizhu.zczy.system.service.PopedomService;



/**
 * 后台管理权限项表
 *
 * @author guoyz
 * @email guoyz@mail.com
 * @date 2021-06-24 18:31:46
 */
@RestController
@RequestMapping("system/popedom")
public class PopedomController {
    @Autowired
    private PopedomService popedomService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("system:popedom:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = popedomService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("system:popedom:info")
    public R info(@PathVariable("id") Integer id){
		PopedomEntity popedom = popedomService.getById(id);

        return R.ok().put("popedom", popedom);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("system:popedom:save")
    public R save(@RequestBody PopedomEntity popedom){
		popedomService.save(popedom);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("system:popedom:update")
    public R update(@RequestBody PopedomEntity popedom){
		popedomService.updateById(popedom);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("system:popedom:delete")
    public R delete(@RequestBody Integer[] ids){
		popedomService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
